// 红石节点抽象层，ReAL 层
// Redstone Abstract Layer，ReAL

#ifndef __RED_STONE_H__
#define __RED_STONE_H__

#include "main.h"

typedef enum {
    RS_STRENGTH_DISCONN = 0,
    RS_STRENGTH_0,
    RS_STRENGTH_0_5,
    RS_STRENGTH_1,
    RS_STRENGTH_2,
    RS_STRENGTH_3,
    RS_STRENGTH_4,
    RS_STRENGTH_5,
    RS_STRENGTH_6,
    RS_STRENGTH_7,
    RS_STRENGTH_8,
    RS_STRENGTH_9,
    RS_STRENGTH_10,
    RS_STRENGTH_11,
    RS_STRENGTH_12,
    RS_STRENGTH_13,
    RS_STRENGTH_14,
    RS_STRENGTH_15,
    RS_STRENGTH_16,

    RS_STRENGTH_SIZE,
} RS_strength_t;

extern uint16_t RS_strength_mv_map[RS_STRENGTH_SIZE];

struct redstone_stu {
    uint16_t (*get_millivolt)(struct redstone_stu *rs);
};

RS_strength_t ReAL_get_strength_min(struct redstone_stu *rs);
RS_strength_t ReAL_get_strength_mid(struct redstone_stu *rs);

#endif // __RED_STONE_H__
